#include "myhead.h"
#include "def.h"
void renFile(char* params[], int paramNumber)
{
	if (paramNumber!=3)
	{
		printf(helpStr);
	}
	else
	{
		if (strcmp(params[1], params[2])==0)
		{
			printf("The source file %s and the destination file %s can not be the same.\n", params[1], params[2]);
		}
		else
		{
			if (access(params[1], F_OK)<0)
			{
				printf("The source file %s does not exist.\n", params[1]);
			}
			else
			{
				if (rename(params[1], params[2])<0)
				{
					printf("cannot rename file from %s to file %s\n", params[1], params[2]);
				}
			}
		}
	}
}